<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/User.Master" Inherits="System.Web.Mvc.ViewPage<mesoBoard.Data.UserProfile>"  ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <% using(Html.BeginForm()) { %>

        <fieldset>
            <legend><%= Html.ThemeImage("cog.png")%> Change Profile</legend>
            
            <dl class="form">
                <dt>Location</dt>
                <dd>
                    <%= Html.TextBox("Location", Server.HtmlDecode(Model.Location))%>
                </dd>

                <dt>Birthdate</dt>
                <dd>
                    <select name="Month">
                        <option value="">Month</option>
                        <% for(int i=1;i<13;i++){ %>
                            <option value="<%= i %>" <%= Model.Birthdate.HasValue && Model.Birthdate.Value.Month == i ? "selected='selected'" : "" %>><%= i %></option>
                        <% } %>
                    </select>
                    <select name="Day">
                        <option value="">Day</option>
                        <% for(int i=1;i<32;i++){ %>
                            <option value="<%= i %>" <%= Model.Birthdate.HasValue && Model.Birthdate.Value.Day == i ? "selected='selected'" : "" %>><%= i %></option>
                        <% } %>
                    </select>
                    <select name="Year">
                        <option value="">Year</option>
                        <% for(int i=1930;i<DateTime.Now.Year;i++){ %>
                            <option value="<%= i %>" <%= Model.Birthdate.HasValue && Model.Birthdate.Value.Year == i ? "selected='selected'" : "" %>><%= i %></option>
                        <% } %>
                    </select>
                    <%= Html.ValidationMessageFor(model => model.Birthdate) %>
                </dd>
                
                <dt>Always show signature</dt>
                <dd>
                    <%= Html.CheckBox("AlwaysShowSignature") %>
                </dd>
                
                <dt>Always subscribe to threads</dt>
                <dd>
                    <%= Html.CheckBox("AlwaysSubscribeToThread")%>
                </dd>

                <% if(!bool.Parse(mesoBoard.Services.SiteConfig.OverrideUserTheme.Value)){ %>
                <dt>Theme</dt>
                <dd>
                    <%= Html.DropDownList("ThemeID") %>
                </dd>        
                <% } %>
                
                <% IEnumerable<Role> UserRoles = (IEnumerable<Role>)ViewData["DefaultRole"];
                   if(UserRoles.Count() != 0){ %>                                
                <dt>Username Color/Image</dt>
                <dd>
                    <select name="DefaultRole" id="DefaultRole">
                        <option value="0">(Choose a group/rank)</option>
                        <% foreach(Role r in UserRoles) { %>
                        <option value="<%= r.RoleID %>" <%= Model.DefaultRole == r.RoleID ? "selected='selected'" : "" %> style="color: <%= r.Rank.Color %>"><%= r.Rank.Title %> - <%= r.Rank.Color %></option>
                        <% } %>
                    </select>
                </dd>
                <% } %>
                
                <dt>AIM Username</dt>
                <dd>
                    <%= Html.TextBox("AIM", Server.HtmlDecode(Model.AIM))%>
                </dd>
                
                <dt>ICQ Number</dt>
                <dd>
                    <%= Html.TextBox("ICQ", Model.ICQ)%>
                    <%= Html.ValidationMessage("ICQ") %>
                </dd>
                
                <dt>MSN Address</dt>
                <dd>
                    <%= Html.TextBox("MSN", Server.HtmlDecode(Model.MSN))%>
                </dd>
                
                <dt>Website URL</dt>
                <dd>
                    <%= Html.TextBox("Website", Server.HtmlDecode(Model.Website))%>
                </dd>
                
                <dt>&nbsp;</dt>
                <dd>
                <%= Html.Hidden("UserID", Model.UserID)%>
                <%= Html.SubmitButton("SaveChanges", "Save Changes")%>
                </dd>
                
            </dl>

        </fieldset>

    <% } %> 
</asp:Content>

